package com.situ.day11;

import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.Panel;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class SwingDemo1 {
	public static void main(String[] args) {
		JFrame jFrame = new JFrame();
		//窗口大小
		jFrame.setSize(500, 400);
		//窗口位置
		jFrame.setLocation(500, 500);
		//窗口可见
		jFrame.setVisible(true);
		jFrame.setTitle("6666666666");
		JPanel jPanel = new JPanel();
		jFrame.add(jPanel);
		//设置布局管理器
		jPanel.setLayout(new BorderLayout());
		//创建组件
		JButton northButton = new JButton("北部"); 
		JButton southButton = new JButton("南部"); 
		JButton westButton = new JButton("西部"); 
		JButton eastButton = new JButton("东部"); 
		JButton centerButton = new JButton("中部"); 
		//添加组件
		jPanel.add(northButton, BorderLayout.NORTH);
		jPanel.add(southButton, BorderLayout.SOUTH);
		jPanel.add(westButton, BorderLayout.WEST);
		jPanel.add(eastButton, BorderLayout.EAST);
		jPanel.add(centerButton, BorderLayout.CENTER);
		//点击关闭能够退出
		jFrame.setDefaultCloseOperation(jFrame.EXIT_ON_CLOSE);
		
		
	}
}
